tot = 0
tot_interest = 0
change = 2000
interest = 0
month_size = 12 * 20  # 约数
month_money = [0] * month_size
rate = 2.5 * 3 / 100
print(rate)


def r(num):
    return round(num, 2)


print("月份，存款到期，到期利息，存入，累计金额，累计利息")
for i in range(month_size):
    dao = 0 if i < 36 else month_money[i - 36]
    interest = dao * rate
    cun = dao + interest + change
    month_money[i] = cun
    tot += interest + change
    tot_interest += interest
    print(i + 1, r(dao), r(interest), r(cun), r(tot), r(tot_interest))
# month_money = month_money[-36::]
# for i, num in enumerate(month_money):
#     print(i + 1, r(num))
# print(r(sum(month_money)))

# all_tot = r(sum(month_money))
# i = 36
# change = 2500
# while r(all_tot) > 0.0:
#     dao = month_money[i - 36]
#     interest = dao * rate
#     change = 2500 if dao + interest > 5000 else dao + interest
#     cun = dao + interest - change
#     month_money.append(cun)
#     all_tot = all_tot + interest - change
#     tot_interest += interest
#     print(i - 35, r(dao), r(interest), r(change), r(cun), r(all_tot), r(tot_interest))
#     i += 1
